1. Field of the Invention
The present invention relates in general to graphic display techniques, and more specifically to a rotated graphic pattern generating system for rotating a graphic pattern stored in a display memory so that a rotated graphic pattern can be displayed.
2. Description of Related Art
Heretofore, in order to rotate a given graphic pattern, two methods have been known.
A first method includes an individual coordinate transformation of a required rotational angle .theta. of respective dots included in a source graphic pattern on a dot by dot basis. All of this processing is executed on a the program-basis.
A second method uses a X-direction straight line generator and a Y-direction straight line generator. The X-direction straight line generator is used to rotate one line of X direction included in a source graphic pattern to be rotated, and the Y-direction straight line generator is used to rotate a left side of the source graphic pattern to be rotated, i.e., a reference point (or a leading point) of each line of the X direction. These generators are used in combination to convert respective dots included in the source graphic pattern in an incremental manner starting from the reference point.
The first method needs a large amount of calculation of trigonometric functions, because the coordinate transformation must be performed for each dot by using the trigonometric functions. Therefore, a long calculation time is inevitably required, and a large amount of hardware must be installed. On the other hand, the second method is free from the above mentioned defect of the first method, because the coordinate transformation can be obtained from only repeated addition and subtraction based on a straight line generation algorithm.
Here, the second method will be explained in more detail with reference to the drawings. FIG. 1A illustrates one example of dot distribution included in a given rectangular pattern P on a source coordinate. FIG. 1B illustrates a rotated straight line generated by the X-direction straight line generator from a line L.sub.1 included in the source pattern P. FIG. 1C illustrates a rotated pattern generated by the X-direction straight line generator and the Y-direction straight line generator in combination from the rectangular pattern P on the source coordinate shown in FIG. 1A.
First, the line L.sub.1 included in the rectangular pattern P on the source coordinate and in parallel to the X-axis of the source coordinate is rotated. For this purpose, the X-direction straight line generator is used to perform the coordinate transformation starting from the leading dot a.sub.1 (XS.sub.1, YS.sub.1) of the line L.sub.1 to the trail end dot on the same line L.sub.1 on a dot by dot basis such that after one dot is coordinate-transformed, another dot adjacent to the transformed dot is coordinate-transformed, so that the coordinate-transformed dots are plotted on a destination coordinate. Now, assuming that the dot (XS.sub.1, YS.sub.1) on the source coordinate is transformed to a dot (XD.sub.1, YD.sub.1) on the destination coordinate, and a rotational angle .theta. is less than 45 degree, the dot (XS.sub.1 +1, YS.sub.1) adjacent to the dot (XS.sub.1, YS.sub.1) on the line L.sub.1 is transformed to
(A) the destination coordinate position (XD.sub.1 +1, YD.sub.1), or PA1 (B) the destination coordinate position (XD.sub.1 +1, YD.sub.1 +1).
Which of (A) and (B) is selected is determined each time a dot is plotted on the destination coordinate so that the deviation is minimized between the dot pattern plotted on the destination coordinate and a straight line M.sub.1 obtained by geometrically rotating the line L.sub.1 by an angle .theta.. In the example of FIG. 1B, (A) and (B) are alternately selected. If the rotation angle .theta. is made smaller, the proportion of time that (A) is selected will become larger.
In the manner as mentioned above, the position to which one dot on the source coordinate is to be coordinate-transformed i.e., moved, is determined on the destination coordinate system, and then, the dot information on the source pattern corresponding to that dot is rewritten to the dot position determined on the destination coordinate. Thereafter, the coordinate transformation of the next dot is executed in the same manner.
Thus, the above mentioned processing is repeatedly performed until the drawing operation is completed over the full length DH of the line L.sub.1 in the X direction. Thereafter, the coordinate transformation is executed on the second line L.sub.2. In this operation, a dot position on the destination coordinate corresponding to the leading dot of the line L.sub.2 on the source coordinate is generated in the Y-direction straight line generator. Then, the other dot positions on the destination coordinate corresponding to the second and succeeding dots of the line L.sub.2 are produced by the X-direction straight line generator, so that a rotated pattern of the second line L.sub.2 is drawn.
The above operation is repeated over a full length DV in the Y direction. Thus, the rotated pattern is drawn as shown in part in FIG. 1C.
However, the second method as mentioned above is disadvantageous in that unredrawn portions are generated in the rotated pattern as indicated by Z.sub.1, Z.sub.2, Z.sub.3 in FIG. 1C. In the unredrawn portions, the information before the rotation of the pattern remains. Such portions Z.sub.1, Z.sub.2, Z.sub.3 etc. are termed "bugs" or "residual portions" or "residual patterns". The rotated pattern having the residual portions in the redrawn area are undesirable.